#ifndef MEDIALOCATOR_H
#define MEDIALOCATOR_H

#include <QDir>
#include <QMutex>
#include <QThread>
#include <QWaitCondition>
#include <Maestro/mcplugins.h>
#include <Maestro/database.h>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <phonon>
#include "mediachecker.h"

class MediaLocator : public QThread
{
    Q_OBJECT
public:
    MediaLocator();
    void addFolder(long long id,QString folder);
    void removeFolder(QString folder);
    void rescan();
protected:
    void run();
private slots:
    //void stateChanged();
private:
    void scanFolder(int folder, QString directory, QString subdirectory);
    QList<MediaFolder *> * listenedFolders;
    QList<MediaFile *> * files;
    QStringList * extensions;
    QWaitCondition condition;
    QMutex * mutex;
    QString valid;
};


#endif // MEDIALOCATOR_H
